/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2023-12-03
 * Time:10:03
 */
public class Thread16 {
    public static void main(String[] args) {
        Object locker1 = new Object();
        Object locker2 = new Object();
        Thread t1 = new Thread(()-> {
            synchronized (locker1) {
                //...
                System.out.println("1111111111");
                synchronized (locker2) {
                    //...
                    System.out.println("22222222222222");
                }
            }

        });
        Thread t2 = new Thread(()-> {
            synchronized (locker2) {
                //...
                System.out.println("3333333333");
                synchronized (locker1) {
                    //...
                    System.out.println("44444444444");
                }
            }

        });
        t1.start();
        t2.start();

    }
}
